import fetch from '@/axios/fetch'


export function accessData() {
  return fetch({
    url: '/api/database/accessData',
    method: 'get'
  })
}

export function getList() {
  return fetch({
    url: '/api/database/list',
    method: 'get'
  })
}

export function connectionNames() {
  return fetch({
    url: '/api/database/names',
    method: 'get'
  })
}

export function save(obj) {
  return fetch({
    url: '/api/database/save',
    method: 'put',
    data: obj
  })
}

export function copy(obj) {
  return fetch({
    url: '/api/database/copy',
    method: 'put',
    data: obj
  })
}


export function test(obj) {
  return fetch({
    url: '/api/database/test',
    method: 'put',
    data: obj
  })
}


export function remove(obj) {
  return fetch({
    url: '/api/database/remove/' + obj,
    method: 'delete'
  })
}

export function getDataBaseById(obj) {
  return fetch({
    url: '/api/database/getDataBaseById/' + obj,
    method: 'get'
  })
}

export function explorer(obj) {
  return fetch({
    url: '/api/database/explorer',
    method: 'post',
    data: obj
  })
}

export function tableFields(obj) {
  return fetch({
    url: '/api/database/tableFields',
    method: 'post',
    data: obj
  })
}

export function getSQL(obj) {
  return fetch({
    url: '/api/database/getSQL',
    method: 'post',
    data: obj
  })
}
